package com.dlnu.shoping.shopping.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dlnu.shoping.shopping.entity.TestUser;
import com.dlnu.shoping.shopping.mapper.provider.SqlProvider;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;


import java.util.HashMap;
import java.util.List;

@Mapper
public interface TestUserMapper extends BaseMapper<TestUser>{
    @Select(value = "select count(*) userCount from test_user")
    HashMap queryUserCount();

    @SelectProvider(type = SqlProvider.class,method = "queryUserListSql")
    List<HashMap> queryUserList(String username,String nickname);

    @SelectProvider(type = SqlProvider.class,method = "queryUserListSql")
    IPage<HashMap> queryUserPage(Page page, String username, String nickname);
}
